With the 'clicked' attribute you can set a script file that is called when user clicks the block. You can use world, origin and player for your script.
clicked="loader.loadScript('xyz.script');";